{% extends "base.html" %}

{% block content %}
<h1>{{ title }}</h1>
{% if error %}
	<strong>{{ error }}</strong><br>
{% endif %}

{% if user.is_authenticated %}
	<i>Hint: Username can not be changed!</i>
	<form id="profile_form" name="profile_form" action="" method="post">
		<table>
			{% for field in form %}
	        <tr>
	        	<td><b>{{ field.label_tag }}:</b></td>        	
	          	<td style="padding-left:5px">{{ field }}{% if field.errors %} <strong>{{ field.errors }}</strong>{% endif %}</td>
	        </tr>
			{% endfor %}		
			<tr>
				<td>&nbsp;</td>
				<td style="padding-left:5px"><input type="submit" value="Save Changes"></td>
			</tr>
		</table>
		<input type="hidden" name='username' value='{{ user.username }}'>
	</form><br>
{% else %}
	<p>
		<strong>Sorry but you are not logged in! 
		<a href="/login">Login</a> before you acces your profile page!</strong>
	</p>
{% endif %}
{% endblock %}